<extend name="Base:base" />
<block name="title">{$title}</block>
<block name="content">
    <table class="table">
        <tr>
            <th>用户ID</th>
            <th>用户名</th>
            <th>登陆次数</th>
            <th>登陆时间</th>
            <th>是否锁定</th>
            <th>用户所属组别</th>
            <th>操作</th>
        </tr>
        <foreach name="list" item="user">
            <tr>
                <td>[{$user.id}]</td>
                <td>{$user.name}</td>
                <td>{$user.logins}</td>
                <td>{$user.last_login|date='y-m-d H:i',###}</td>
                <td>
            <if condition="$user.is_active == null">[启用]
                <else />[锁定]
            </if>
            </td>
            <td>
                <ul>
                    <if condition="$user['name'] eq C('RBAC_SUPERADMIN')">
                        超级管理员
                        <else />         
                        <foreach name="user.roles" item="role">
                            <li>
                                {$role.name}({$role.remark})
                            </li>
                        </foreach>
                    </if>
                </ul>
            </td>
            <td>
                <a href="">锁定</a>|
                <a href="{:U('Admin/Rbac/editUser',array('id'=>$user['id']))}">修改</a>|
                <a onclick="return confirm('是否确定要删除?');" href="{:U('Admin/Rbac/deleteUser',array('id'=>$user['id']))}">删除</a>
            </td>
            </tr>
        </foreach>
    </table>
    <div class="digg">{$page}</div>

</block>
